import cvmfs_plugin
import time

if __name__ == '__main__':
    import sys, os
    if len(sys.argv) != 3:
        print "Usage: %s <target_pid> <other_peer>" % sys.argv[0]
        sys.exit(0)

    time.sleep(8)

    # we don't have to subclass Plugin because we don't need to handle incoming
    # messages
    singer = cvmfs_plugin.Plugin(int(sys.argv[1]))

    genres = ['Pop', 'Rock', 'Jazz']
    for i in range(3):
        singer.unicast(sys.argv[2], genres[i],
                "this is mock playing music at pid %d" % os.getpid())
        time.sleep(1)

    while True:
        time.sleep(1)

